import json

class DbHelper:
    def __init__(self) -> None:
        self.dataPath = "data.json"

        try:
            self.getData()
        except:
            self.storeData({})
            print(f"{self.dataPath} not exist, new one has been created.")

    
    def storeData(self, data):
        with open(self.dataPath, "w") as jsonFile:
            json.dump(data, jsonFile)


    def getData(self):
        with open(self.dataPath, "r") as jsonFile:
            return json.load(jsonFile)
        


if __name__ == "__main__":
    DbHelper()

